package com.cyurs.netty.dubborpc.provider;

import com.cyurs.netty.dubborpc.publicInterface.HelloService;

/**
 * @Author: Cyrus
 * @CreateDate: 2020/11/30
 */
public class HelloServerImpl implements HelloService {
    /**
     * 当消费方调用该方法时，返回一个结果
     */
    private static int count = 0;
    @Override
    public String hello(String msg) {
        System.out.println("收到客户端消息="+msg);
        //根据msg返回不同结果
        if (msg != null) {
            return "你好客户端，我收到了你发来的消息[" + msg + "] 第"+(++count)+"次调用";
        } else {
            return "你好客户端，我收到了你发来的消息";
        }
    }
}
